/**
 * Created by ASUS on 2018/1/10.
 */
function initRegister(){
    //需要初始化一个变量来存计时器id
    var codeIntervalId = 0;


    var registerVueObjOne = new Vue({
        el:"#mainBox",
        data:{
            registerStep:0,
            registerTypeOnePhone:"",
            registerTypeOneCode:"",
            getCodeBtnTxt:"获取验证码",
            isSendCode:false,
            isCheckProtocol:false
        },
        methods:{
            clearTxt:function(){
                this.registerTypeOnePhone = ""
            },
            checkProtocol:function () {
                this.isCheckProtocol = !this.isCheckProtocol
            },
            getRegisterCode:function(){
                if(this.isSendCode){
                    return;
                }
                var phone = Number(this.registerTypeOnePhone.trim());
                this.isSendCode = true;
                console.log(phone);
                var _this = this;
                var num = 10;
                clearInterval(codeIntervalId);
                codeIntervalId = setInterval(function () {
                    _this.getCodeBtnTxt = "已发送("+(num - 1)+")";
                    num = num - 1;
                    if(num < 1){
                        _this.isSendCode = false;
                        _this.getCodeBtnTxt = "获取验证码"
                    }
                },1000);

            }
        }
    });
    var registerVueObjTwo = new Vue({
        el:"#mainBox2",
        data:{
            registerStep:1,
            registerPassword:"",
            registerPasswordCheck:"",
            registerPasswordShow:false,
            registerPasswordCheckShow:false
        },
        methods:{
            setShow:function (num) {
                if(num==0){
                    this.registerPasswordShow = !this.registerPasswordShow;
                }else{
                    this.registerPasswordCheckShow = !this.registerPasswordCheckShow;
                }
            }
        }
    })

}